<?xml version="1.0" encoding="utf-8"?>
<xs:schema targetNamespace="http://www.nettiers.com/NetTiersMap.xsd" elementFormDefault="qualified" xmlns="http://www.nettiers.com/NetTiersMap.xsd" xmlns:mstns="http://www.nettiers.com/NetTiersMap.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:complexType name="TableMetaData">
      <xs:sequence>
            <xs:element name="Column" type="ColumnMetaData" minOccurs="0" maxOccurs="unbounded" />
   	     <xs:element name="ChildCollection" type="ChildCollectionMetaData" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="Id" type="xs:string" use="required" />
      <xs:attribute name="EntityName" type="xs:string" />
      <xs:attribute name="Owner" type="xs:string" />
      <xs:attribute name="FieldName" type="xs:string" />
      <xs:attribute name="PropertyName" type="xs:string" />
      <xs:attribute name="FriendlyName" type="xs:string" />
   	  <xs:attribute name="IncludeInOutput" type="xs:boolean" />
</xs:complexType>
<xs:complexType name="ViewMetaData">
      <xs:sequence>
            <xs:element name="Column" type="ColumnMetaData" minOccurs="0" maxOccurs="unbounded" />
      </xs:sequence>
      <xs:attribute name="Id" type="xs:string" use="required" />
      <xs:attribute name="EntityName" type="xs:string" />
      <xs:attribute name="Owner" type="xs:string" />
      <xs:attribute name="FieldName" type="xs:string" />
      <xs:attribute name="PropertyName" type="xs:string" />
      <xs:attribute name="FriendlyName" type="xs:string" />
   	  <xs:attribute name="IncludeInOutput" type="xs:boolean" />
</xs:complexType>
   <xs:complexType name="ColumnMetaData">
      <xs:attribute name="Id" type="xs:string" use="required" />
      <xs:attribute name="FriendlyName" type="xs:string" />
      <xs:attribute name="CSType" type="xs:string" />
      <xs:attribute name="FieldName" type="xs:string" />
      <xs:attribute name="PropertyName" type="xs:string" />
	  <xs:attribute name="IncludeInOutput" type="xs:boolean" />
   </xs:complexType>
   <xs:complexType name="ChildCollectionMetaData">
      	<xs:attribute name="Id" type="xs:string" use="required" />
         <xs:attribute name="FriendlyName" type="xs:string" />
         <xs:attribute name="CSType" type="xs:string" />
         <xs:attribute name="PropertyName" type="xs:string" />
         <xs:attribute name="FieldName" type="xs:string" />
         <xs:attribute name="RelationshipType" use="required">
			 <xs:simpleType>
			   <xs:restriction base="xs:string">
				 <xs:enumeration value="OneToMany"/>
				 <xs:enumeration value="ManyToOne"/>
				 <xs:enumeration value="ManyToMany"/>
				 <xs:enumeration value="OneToOne"/>
			   </xs:restriction>
			 </xs:simpleType>
      	</xs:attribute>
      	<xs:attribute name="ForeignKeyName" type="xs:string" />
		<xs:attribute name="IncludeInOutput" type="xs:boolean" />
   </xs:complexType>
   <xs:element name="NetTiersMap">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="Table" type="TableMetaData" minOccurs="0" maxOccurs="unbounded" />
            <xs:element name="View" type="ViewMetaData" minOccurs="0" maxOccurs="unbounded" />
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>
